package io.renren.modules.medical.vo.medicalVo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

/**
 * @author Luo Sheng
 * @school YiBin university
 * @create 2023-04-14 22:45
 */
@Data
public class HealthEducationSaveVo {
    @NotNull(message = "修改必须指定id", groups = {UpdateGroup.class})
    @Null(message = "新增不能指定id", groups = {AddGroup.class})
    private Long id;

    @NotBlank(message = "标题不能为空", groups = {UpdateGroup.class, AddGroup.class})
    private String title;

    @NotBlank(message = "文本内容不能为空", groups = {UpdateGroup.class, AddGroup.class})
    private String content;

    @NotBlank(message = "默认图片路径不能为空", groups = {UpdateGroup.class, AddGroup.class})
    private String defaultPic;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @NotNull(message = "发布时间不能为空", groups = {UpdateGroup.class, AddGroup.class})
    private Date publishTime;
}
